﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Jobping.Database
{
    public enum DatabaseProvider
    {
        SqlServer
    }

    public class MigrationHelper
    {
        public MigrationHelper(DatabaseProvider provider, string connectionString)
        {
            this.ConnectionString = connectionString;
        }

        private string ConnectionString { get; set; }

        private DatabaseProvider Provider { get; set; }

        public void MigrateTo(int number)
        {
            Migrator.Migrator m = new Migrator.Migrator(this.Provider.ToString(), this.ConnectionString, typeof(MigrationHelper).Assembly);
            m.MigrateTo(number);
        }

        public void MigrateToLatest()
        {
            Migrator.Migrator m = new Migrator.Migrator(this.Provider.ToString(), this.ConnectionString, typeof(MigrationHelper).Assembly);
            m.MigrateToLastVersion();
        }

    }
}
